package day02;

public class Demo09 {

	public static void main(String[] args) {
		Foo foo = new Foo(5, 7);
		foo.move();
		foo.move();
		foo.move();
		System.out.println(foo);
		foo.move();
		foo.move();
		foo.move();
		System.out.println(foo);
		foo.move();
		foo.move();
		foo.move();
		System.out.println(foo);

	}

}

class Foo {
	int x;
	int y;

	Foo(int x, int y) {
		this.x = x;
		this.y = y;

	}

	public void move() {
		x++;
		y += 2;
	}

	public String toString() {
		return x + "," + y;
	}

}